package com.miage.m1.javabrowser;

// Creer une Frame unique pour tous nos plugins
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class FgFrame extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	JScrollPane scrollBar;

	public FgFrame(Browser b, JPanel jp, String title) {

		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		this.setSize(b.dim.width * 6 / 10, b.dim.height * 6 / 10);
		this.setTitle(title);
		if (jp != null) {
			scrollBar = new JScrollPane(jp, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
			scrollBar.setPreferredSize(new Dimension(200, 100));
			this.getContentPane().add(scrollBar,BorderLayout.CENTER);
		scrollBar.revalidate();
	
		}		
		this.setVisible(true);
	}
}
